package com.mujin.keji.collectionsystem.module.mypager.viewmodel;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;

import com.mujin.keji.collectionsystem.base.BaseDto;
import com.mujin.keji.collectionsystem.base.BaseVo;
import com.mujin.keji.collectionsystem.module.mypager.dto.LogoutDto;
import com.mujin.keji.collectionsystem.module.mypager.repository.ILogoutRepository;
import com.mujin.keji.collectionsystem.module.mypager.repository.LogoutRepository;

/**
 * 退出登录viewmodel
 *
 * @author weishixiong
 * @Time 2018-04-27
 */
public class LogoutViewModel extends ViewModel {
    private LiveData<BaseDto<LogoutDto>> liveData;
    private ILogoutRepository logoutRepository;
    public LiveData<BaseDto<LogoutDto>> getLiveData() {
        logout();
        return liveData;
    }

    /**
     * 退出登录
     */
    private void logout() {
        logoutRepository = new LogoutRepository();
        this.liveData = logoutRepository.logout(new BaseVo());
    }




}
